Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
force-pushed
the
fix/agent-instructions-real-path
branch
from
December 2, 2026 17:06
45ed539 to
64f7e62
Compare
zlareb1
marked this pull request as draft
December 2, 2026 17:22
~/ import of AGENTS.md under any spelling of the home folder
…does agent-instructions compared paths through the JavaScript realpathSync, which keeps a Windows 8.3 name and letter case, while the checkout root comes through realPath. A configuration folder or `~/` import spelled another way then missed, and setup wrote a CLAUDE.md holding only `@AGENTS.md`. Every comparison now goes through realPath, and the setup tests' scratch folders take its spelling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ames its target once The test now runs setup with the home folder as created and with its upper- and lower-cased spellings where the file system holds them, so the ~/ import case runs on Linux too and a lowercase drive letter is covered on Windows. The check for a CLAUDE.md above the temporary folder walks the spelling the scratch folders use. imports() resolves its target before reading the lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Claude Code knows its own CLAUDE.md by the spelling HOME or CLAUDE_CONFIG_DIR gives it. Under another spelling (other letter case on macOS) it reads that file as one above the checkout and leaves AGENTS.md unread, so the @AGENTS.md import setup writes there is the one the client needs. agentsUnreadFor compares that file by the spelling given again. An import is read under any spelling of its path, so imports() still names both sides as the file system does. The test pins both: another spelling of the configuration folder gets the import, and a ~/ import under any spelling counts as reading AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…pelling and follows a ~/ import Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
zlareb1
force-pushed
the
fix/agent-instructions-real-path
branch
from
December 3, 2026 10:25
6c7f7a4 to
4201571
Compare
zlareb1
marked this pull request as ready for review
December 3, 2026 10:26
…, on every platform clientSpelling (was real) keeps the spelling Claude Code knows its own CLAUDE.md by, and the comment and the integration page name USERPROFILE beside HOME. Both behaviour claims name the Claude Code version they were checked on, 2.1.335. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
imports() takes the spelling it compares by. The repository's CLAUDE.md compares its import as written (clientSpelling), so a file system that folds letter case no longer moves the block: `@agents.md` beside AGENTS.md keeps the block in CLAUDE.md on every machine. Files outside the checkout keep the file system's spelling (realPath), whose docstring now names letter case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
asWritten (was clientSpelling) says what it returns; imports() takes its spelling at both call sites, each with its reason. realPath folds letter case on macOS and Windows only, and the integration page names the Claude Code version the CLAUDE.md spelling was checked on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #2032
Related: #2030
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
In a checkout below a CLAUDE.md that imports AGENTS.md through
~/,loom-setupno longer adds a CLAUDE.md, and the session-start notice and status check no longer call the AGENTS.md block unread, whenHOMEnames the home folder other than as the file system spells it, such as in other letter case.Why
#2032 reported that setup writes a CLAUDE.md holding only
@AGENTS.mdwhenHOME,USERPROFILEorCLAUDE_CONFIG_DIRspells the home or configuration folder other than as the file system names it. Claude Code also leaves AGENTS.md unread under such a spelling, so that import is the one it needs. On macOS, with Claude Code 2.1.334, a checkout under the home folder, text in~/.claude/CLAUDE.mdand an AGENTS.md at the root holding a marker word,claude -pasked for the marker without reading any file:HOME=/Users/<name>HOME=/USERS/<NAME>CLAUDE_CONFIG_DIR=/USERS/<NAME>/.claudeHOME=/USERS/<NAME>, CLAUDE.md at the root holding@AGENTS.mdHOME=/USERS/<NAME>, a CLAUDE.md above the checkout holding@~/<dir>/checkout/AGENTS.mdThe client knows its own CLAUDE.md by the spelling it is given. Under another spelling it reads that file as one above the checkout and leaves AGENTS.md unread.
agentsUnreadForinlib/agent-instructions.mjskeeps that spelling (real(), the JavaScriptfs.realpathSync, which keeps letter case and an 8.3 name), so setup's answer was right. A comment there now says why. An earlier commit on this branch had replaced it withrealPath, which would have left the block in an AGENTS.md the client does not read.The bug is in
imports(). A CLAUDE.md above the checkout that imports AGENTS.md through~/counts as reading it.~/expands toHOMEas given, andreal()kept that spelling, while the target is named as the checkout's root is (realPath, throughgitToplevel). So under another spelling ofHOMEthe import went unseen: setup added a CLAUDE.md the client did not need, and the session-start notice andloom-client-status, which read the sameagentsUnreadForresult, called the block unread. The client reads an import under any spelling of its path, soimports()now names both sides withrealPath, and names its target once.Scope and risk
lib/agent-instructions.mjs, its Codex copy (synced), and both plugin manifests at 1.2.162, which no other open pull request uses.realPathnever throws, and SessionStart and the status check read the sameagentsUnreadForresult as setup, so the change reaches them with no new failure path.scratch()returnsrealPathof the new folder, so every setup test spells its folders as setup does; The setup tests pass on Windows, where the temp folder has an 8.3 name #2030'srealScratchhelper is folded into it. The check for a CLAUDE.md above the temporary folder walks that same spelling alone.~/import,realPathnow expands an 8.3USERPROFILEand a drive letter's case, so such an import counts as reading AGENTS.md there too, which the macOS run shows for letter case.Compatibility, rollout and rollback
Tests
agent-instructions.test.mjstest: the home folder as created, and its upper- and lower-cased spellings where the file system holds them (macOS and Windows; the lower case also lowers a drive letter). With the configuration folder named throughHOMEand throughCLAUDE_CONFIG_DIR, the spelling as created gets the block in AGENTS.md and no CLAUDE.md, and another spelling gets the@AGENTS.mdimport. With a CLAUDE.md above the checkout importing~/work/checkout/AGENTS.md, every spelling gets the block in AGENTS.md and no CLAUDE.md. On Linux the spelling as created runs alone.realPathfails the new test, and so does main'simports().tests/unit/test_codex_plugin.py,test_agent_plugin.py,test_plugin_checkout_bytes.py,test_session_content_senders.py,test_doc_links.pyandtest_public_copy.py, biome, andmake format-check lintpass.docs/features/integrations/claude-code.mdsays the client knows its own CLAUDE.md by the spelling it is given and counts a~/or whole-path import.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (Claude Code): ran Claude Code under each spelling of
HOMEandCLAUDE_CONFIG_DIRto see which instruction files it loads, traced the comparisons inagentsUnreadForandimports, and ran the test against both mutants.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.python -m scripts.codegen.agent_plugin_sync); the standalone skills are unchanged.main; no merged migration is edited: none.frontend/changed: not changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code
Note
Low Risk
Localized path-normalization in instruction setup; broader realPath use on imports may affect edge cases on Windows but aligns with observed Claude Code behavior.
Overview
Fixes
loom-setupand instruction status whenHOME,USERPROFILE, orCLAUDE_CONFIG_DIRspell paths differently from the filesystem (e.g. alternate letter case on macOS). Setup no longer spuriously adds a rootCLAUDE.mdwith only@AGENTS.md, and session-start / status no longer mark the block unread when a parentCLAUDE.mdalready importsAGENTS.mdvia~/.imports()now compares both sides through a configurable normalizer:realPathfor “does this import reach AGENTS.md?” (matches Claude Code’s case-insensitive~/resolution), andasWritten(renamed fromreal) for the user configCLAUDE.mdvs parent-folder files and for in-repo@agents.mdvsAGENTS.mdon case-folding volumes.Docs describe config-folder spelling and import forms; plugin versions bump to 1.2.162 (Claude + Codex). Tests cover alternate home spellings and case-folded import targets.
Reviewed by Cursor Bugbot for commit 5bba514. Bugbot is set up for automated code reviews on this repo. Configure here.